package com.shark.uh.enums;

public enum RoleStatus {
    ACTIVE("Active", "用户处于活跃状态"),
    INACTIVE("Inactive", "用户未激活或已停用"),
    BANNED("Banned", "用户被禁止访问"),
    PENDING("Pending", "用户等待激活"),
    DELETED("Deleted", "用户已被删除");

    private final String status;
    private final String description;

    // 构造函数
    RoleStatus(String status, String description) {
        this.status = status;
        this.description = description;
    }

    // 获取状态
    public String getStatus() {
        return status;
    }

    // 获取描述
    public String getDescription() {
        return description;
    }

    // 根据状态名称获取枚举
    public static RoleStatus fromStatus(String status) {
        for (RoleStatus roleStatus : RoleStatus.values()) {
            if (roleStatus.getStatus().equalsIgnoreCase(status)) {
                return roleStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant for status: " + status);
    }


}
